Open
Conversation
zinelya
reviewed
Jan 28, 2025
| :align: right | ||
|
|
||
| .. code-block:: bash | ||
| Let's say you want to develop Scilpy. Instead of cloning Scilpy directly on your computer, you should **fork** it, i.e. copy it as one of your own repositories in your own account. On Github, you can find the button *fork* on the top right of Scilpy's repository page. Then, you can clone this copy of the repository on your computer (find the link by clicking on Github's green button *Code*): :bash:`git clone INSERT_LINK_TO_YOUR_FORKED_REPOSITORY` |
Contributor
CHrlS98
reviewed
Jun 6, 2025
Contributor
CHrlS98
left a comment
There was a problem hiding this comment.
5 months later, never too late!
| # Delete a branch: | ||
| git branch -d my_branch # For a local branch | ||
| git push origin --delete my_branch # For a branch on origin | ||
| When working in a branch other than the main one (*master* or *main*), you should often save (update) your modifications online. Each update is called a **commit**. First, to see which files have been modified without telling Git, use :bash:`git status`. Then, to add or update a file in Git's memory, use :bash:`git add my_file`. You can also add all files that have been modified and that Git already knew about, with :bash:`git add -u`. If you check again with :bash:`git status`, everything in green will be recorded with the next command: :bash:`git commit -m "Message to explain the work I have been doing in this update"`. To send these changes to the same branch name in your forked repository, use :bash:`git push origin my_branch`. |
Contributor
There was a problem hiding this comment.
Could we explain that a commit is not automatically backed up online, it is only a checkpoint made locally until it is pushed.
Comment on lines
-155
to
+126
| git push origin my_branch # Will automatically send it to the same branch name in your forked repo. | ||
| In Git, your working directory is the local folder containing the current state of your project files. As you make changes to these files, they are tracked by Git but not yet committed (see :bash:`git status`). | ||
|
|
||
| # From your forked repo to the upstream repo: | ||
| # Use the Pull Request button on internet | ||
| The staging area, also known as the index, is an intermediate space where you can organize and prepare the changes you want to include in your next commit (see :bash:`git add`). By adding changes to the staging area, you're essentially telling Git which changes should be recorded in the upcoming commit (see :bash:`git commit`). Your local repository is the hidden .git folder within your working directory, where Git stores the entire version history, including all commits and branches. It is separate from the working directory, ensuring that your project's history is preserved even if you make changes or delete files in your working directory. | ||
|
|
||
| # From your local repo to the upstream repo: | ||
| # DON'T DO THAT. Didn't you see that there is no such arrow on Figure 1! | ||
| A remote repository is a version of your project stored on a remote server, allowing for collaboration with other developers. You can push your local commits (see :bash:`git push`) to the remote repository and pull changes made by others (see :bash:`git pull` or :bash:`git fetch`), keeping your project in sync across multiple environments. |
Contributor
There was a problem hiding this comment.
I feel like this should be said earlier, maybe it would fit where commits and pushes are explained.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Here is a new Git page, which is a fusion of both previous pages about Git. It is mostly the one previously found in the good practice section, but I salvaged some parts of the other Git page. Also removed the good practice section.
I would encourage building the html for this review. It wont be easy directly on Github.